export default {
  data() {
    let handlerCertificatesNumber = (rule, value, callback) => {
      if (!this.regCheck('empty', value)) {
        callback(new Error('请输入证件号码'))
      } else {
        callback()
      }
    }
    return {
      ruleForm: {
        handlerName: '', //经办人姓名
        handlerCertificatesType: '', //证件类型
        handlerCertificatesNumber: '', //证件号码
        Verification_Code: '' // 验证码
      },
      rules: {
        handlerName: [
          { required: true, message: '请输入经办人姓名', trigger: 'blur' },
        ],
        handlerCertificatesType: [
          { required: true, message: '请选择经办人证件类型', trigger: 'change' },
        ],
        handlerCertificatesNumber: [
          {
            required: true,
            validator: handlerCertificatesNumber,
            trigger: 'blur',
          },
        ],
        Verification_Code: [
          { required: true, message: '请输入验证码', trigger: 'blur' },
          { trigger: 'blur', validator: (rule, value, callback) => {
              if(value != this.realCode) {
                callback(new Error('验证码错误'))
              } else {
                callback()
              }
            }
          }
        ]
      }
    }
  }
}